<?php
$this
	->widget('zii.widgets.grid.CGridView',
		array(
			'id' => 'material-receipt-dynamic-grid',
			'dataProvider' => new CArrayDataProvider($models, array(
				'pagination' => false
			)),
			'template' => "{items}",
			'enablePagination' => false,
			'columns' => array(
				array(
					'class' => 'CCheckBoxColumn',
					'name' => 'id',
					'checkBoxHtmlOptions' => array(
						'name' => 'addMaterialReceiptIds[]'
					)
				),
				array(
					'header' => '',
					'type' => 'raw',
					'value' => '$row+1'
				),
				array(
					'header' => '日期',
					'name' => 'receiptDate'
				),
				array(
					'name' => 'totalPrice',
					'type' => 'currency',
					'header' => '总价',
				),
				array(
					'name' => 'handler',
					'header' => '经手人',
				),
				array(
					'header' => '票据号码',
					'type' => 'raw',
					'value' => 'CHtml::link($data->token,array("materialReceipt/view","id"=>$data->id),array("target"=>"_blank"))',
				),
				array(
					'header' => '商家',
					'type' => 'raw',
					'value' => '$data->merchantId?$data->merchant->name:" "'
				),
				array(
					'name' => 'note',
					'header' => '备注',
				),
			),
		));
